/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/* 
 * File:   LookAtBall.h
 * Author: czq
 *
 * Created on March 27, 2018, 10:29 AM
 */

#ifndef LOOKATBALL_H
#define LOOKATBALL_H
option(LookAtBall)
{
    initial_state(lookAtBall)
    {
        transition
        {
            if(theLibCodeRelease.timeSinceBallWasSeen > 2500)
                goto lookForBall;
        }
        action
        {
            Vector3f theBall(theBallModel.estimate.position.x(),theBallModel.estimate.position.y(),50.0f);
            SetHeadTargetSpeedRequest(theBall);
        }       
    }
    
    state(lookForBall)
    {
        transition
        {
            if(theBallModel.seenPercentage>0.8)
                goto lookAtBall;
        }
        action
        {
            LookUpAndDown();
            LookLeftAndRight();
        }
    }
}



#endif /* LOOKATBALL_H */

